<?php

$createsql = "create table ".$tableforwarder."_littleforum (id int unsigned, instance varchar(40), topic int unsigned, parent int unsigned, headline varchar(255), body text, author varchar(100), authoremail varchar(255), showauthor enum('Y','N'),built bigint unsigned);";
$createsql = "create table ".$tableforwarder."_littleforum_topic (id int unsigned, name varchar(255));";

class Forum
{
  var $udba;
  var $tablename;
  var $tableforwarder;

  function Forum(&$udba,$tablename,$tableforwarder='')
  {
    $this->udba = &$udba;
    $this->tablename = $tablename;
    $this->tableforwarder = $tableforwarder;
  }

  function addArticle($instance,$topic,$parent,$headline,$body,$author,$authoremail,$showauthor)
  {
    if ($instance && $topic && $headline && $body && $author && $authoremail)
    {
      if (!$showauthor)
        $showauthor = 'N';
      $this->udba->query("insert into ".$this->tableforwarder." (instance topic, parent, headline, body, author, authoremail, showauthor) values ("
        .$this->udba->quote($instance).",$topic,$parent,".$this->udba->quote($headline).",".$this->udba->quote($body).",".$this->udba->quote($author)
        .",".$this->udba->quote($authoremail).",'$showauthor');");
    }
  }
  
}



?>